import 'package:high_help_apps/common/entities/life_help/commodity_info_request_entity.dart';

commodityInfoRequestEntityFromJson(CommodityInfoRequestEntity data, Map<String, dynamic> json) {
	if (json['title'] != null) {
		data.title = json['title'].toString();
	}
	if (json['current'] != null) {
		data.current = json['current'] is String
				? int.tryParse(json['current'])
				: json['current'].toInt();
	}
	if (json['size'] != null) {
		data.size = json['size'] is String
				? int.tryParse(json['size'])
				: json['size'].toInt();
	}
	return data;
}

Map<String, dynamic> commodityInfoRequestEntityToJson(CommodityInfoRequestEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['title'] = entity.title;
	data['current'] = entity.current;
	data['size'] = entity.size;
	return data;
}